Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend optimization methods #37

Merged
merged 13 commits into from
Sep 1, 2024

Conversation

Glowster
Copy link
Collaborator

Added functionality to sample tree topologies with the metropolis_sample function, given a branch model and leaf node data.

@Glowster
Copy link
Collaborator Author

PR brakes backwards compatibility because I have renamed the branchlength_optim! kwarg bl_optimizer to bl_modifer and the nni_optim! kwarg acc_rule to nni_selection_rule, (it is because of this the runtest.jl fails, it is a instance where we call bl_optimizer=BrentsMethodOpt() instead of bl_modifer = BrentsMethodOpt())

@murrellb murrellb requested a review from nossleinad August 26, 2024 20:44
Copy link
Collaborator

@nossleinad nossleinad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general. I think we should break backwards-compat since this PR allows for more flexible behaviours of branchlength_optim! and nni_optim!. kwargs should probably be renamed for the sake of clarity.

See my more detailed comments and please update the tests so that they pass.

src/core/algorithms/nni_optim.jl Outdated Show resolved Hide resolved
src/bayes/sampling.jl Outdated Show resolved Hide resolved
src/bayes/sampling.jl Show resolved Hide resolved
src/utils/simple_sample.jl Outdated Show resolved Hide resolved
src/core/algorithms/nni_optim.jl Outdated Show resolved Hide resolved
src/core/algorithms/branchlength_optim.jl Outdated Show resolved Hide resolved
src/utils/simple_optim.jl Show resolved Hide resolved
src/utils/simple_optim.jl Outdated Show resolved Hide resolved
src/core/nodes/FelNode.jl Show resolved Hide resolved

Returns a untangled copy of the a tree. Optionally, the flag `shallow_copy` can be used to obtained a copy of the tree with only the names and branchlengths.
"""
function copy_tree(root::FelNode, shallow_copy=false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have any performance comparisons between deepcopy(tree) and copy_tree(tree)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't benchmarked this. I can look into this. Do you have any specific benchmark in mind? Like the time etc.?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could use @benchmark from BenchmarkTools.jl to get time, allocs etc.

@nossleinad nossleinad merged commit dd76845 into MurrellGroup:main Sep 1, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants